<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Form_validation extends CI_Form_validation {

    function __construct() {
        parent::CI_Form_validation();
    }

    // --------------------------------------------------------------------

    /**
     * Valid Date (ISO format)
     *
     * @access    public
     * @param    string
     * @return    bool
     */
    function valid_date($str) {
        $this->set_message('valid_date','Date must be valid.');
        $dt = strtotime($str);
        if(checkdate(date('m',$dt),date('d',$dt),date('Y',$dt))){
            return TRUE;
        }else{
            return FALSE;
        }
    }

}
?>